;*******************************************************************************
; Name: gdt_a.asm
; Copyright: Kieran Foot 2009
; Author: Kieran Foot
; Date: 12/06/09 12:35
; Description: ASM GDT Flush routine
;*******************************************************************************

[SECTION .text]

;------------------------;
; GDT Pointer from GDT.C ;
;------------------------;
[EXTERN _gdt_p]

;-------------------------------;
; ASM Function to flush the GDT ;
;-------------------------------;
[GLOBAL _gdt_flush]
_gdt_flush:
    lgdt [_gdt_p]
    mov ax, 0x10
    mov ds, ax
    mov es, ax
    mov fs, ax
    mov gs, ax
    mov ss, ax
    jmp 0x08:gdt_flush2
gdt_flush2:
    ret
